package com.sm.domain.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
	private Boolean success;
	private String errorMsg;
	private Object data;
	private Long total;

	public static Result ok() {
		return new Result(true, null, null, null);
	}

	public static Result ok(Object data) {
		return new Result(true, null, data, null);
	}

	public static Result ok(Object data, Long total) {
		return new Result(true, null, data, total);
	}

	public static Result error(String errorMsg) {
		return new Result(false, errorMsg, null, null);
	}
}
